package com.douqu.game.core.entity;


import com.douqu.game.core.util.LogUtils;

/**
 * @author wangzhenfei
 *         2018-01-12 16:35
 */
public class GMSetting {


    /**
     * 临时存储
     */
    private LogUtils.LOG_LEVEL mainLog = LogUtils.LOG_LEVEL.DEBUG;

    /**
     * 临时存储
     */
    private LogUtils.LOG_LEVEL battleLog = LogUtils.LOG_LEVEL.DEBUG;

    /**
     * 临时存储
     */
    private LogUtils.LOG_LEVEL activityLog = LogUtils.LOG_LEVEL.DEBUG;

    /**
     * 临时存储
     */
    private LogUtils.LOG_LEVEL activityBattleLog = LogUtils.LOG_LEVEL.DEBUG;


    /**
     * 玩家超时时间(毫秒)->只要玩家在这个时间里不做任何操作,就会T下线
     * 为0的时候表示永不掉线
     */
    private int playerOverdueTime = 10 * 60 * 1000;

    /**
     * 登录排队时间(排队人数*排队时间=总排队时间)
     */
    private int playerWaitTime = 5 * 1000;

    /***/
    private boolean sendWelcomeMail = true;

    /**
     * 是否关闭阵营战
     */
    private boolean closeCampActivity = false;

    /**
     * 战斗超时处理成AI
     */
    private boolean battleTimeoutToAI = true;

    public GMSetting copyBattleSetting()
    {
        GMSetting settingEntity = new GMSetting();
        settingEntity.setBattleLog(battleLog);
        settingEntity.setMainLog(mainLog);
        settingEntity.setPlayerWaitTime(playerWaitTime);
        settingEntity.setPlayerOverdueTime(playerOverdueTime);
        settingEntity.setSendWelcomeMail(sendWelcomeMail);
        return settingEntity;
    }


    public void setMainLog(LogUtils.LOG_LEVEL mainLog, LogUtils.LOG_LEVEL battleLog)
    {
        this.mainLog = mainLog;
        this.battleLog = battleLog;
        LogUtils.setLogLevel(mainLog);
    }

    public void setActivityLog(LogUtils.LOG_LEVEL activityLog, LogUtils.LOG_LEVEL activityBattleLog)
    {
        this.activityLog = activityLog;
        this.activityBattleLog = activityBattleLog;
    }

    public int getPlayerOverdueTime() {
        return playerOverdueTime;
    }

    public void setPlayerOverdueTime(int playerOverdueTime) {
        this.playerOverdueTime = playerOverdueTime;
    }

    public int getPlayerWaitTime() {
        return playerWaitTime;
    }

    public void setPlayerWaitTime(int playerWaitTime) {
        this.playerWaitTime = playerWaitTime;
    }

    public LogUtils.LOG_LEVEL getMainLog() {
        return mainLog;
    }

    public void setMainLog(LogUtils.LOG_LEVEL mainLog) {
        this.mainLog = mainLog;
    }

    public LogUtils.LOG_LEVEL getBattleLog() {
        return battleLog;
    }

    public void setBattleLog(LogUtils.LOG_LEVEL battleLog) {
        this.battleLog = battleLog;
    }

    public boolean isSendWelcomeMail() {
        return sendWelcomeMail;
    }

    public void setSendWelcomeMail(boolean sendWelcomeMail) {
        this.sendWelcomeMail = sendWelcomeMail;
    }

    public LogUtils.LOG_LEVEL getActivityLog() {
        return activityLog;
    }

    public void setActivityLog(LogUtils.LOG_LEVEL activityLog) {
        this.activityLog = activityLog;
    }

    public LogUtils.LOG_LEVEL getActivityBattleLog() {
        return activityBattleLog;
    }

    public void setActivityBattleLog(LogUtils.LOG_LEVEL activityBattleLog) {
        this.activityBattleLog = activityBattleLog;
    }

    public boolean isCloseCampActivity() {
        return closeCampActivity;
    }

    public void setCloseCampActivity(boolean closeCampActivity) {
        this.closeCampActivity = closeCampActivity;
    }

    public boolean isBattleTimeoutToAI() {
        return battleTimeoutToAI;
    }

    public void setBattleTimeoutToAI(boolean battleTimeoutToAI) {
        this.battleTimeoutToAI = battleTimeoutToAI;
    }

    @Override
    public String toString() {
        return "{" +
                "mainLog=" + mainLog +
                ", battleLog=" + battleLog +
                ", activityLog=" + activityLog +
                ", activityBattleLog=" + activityBattleLog +
                ", playerOverdueTime=" + playerOverdueTime +
                ", playerWaitTime=" + playerWaitTime +
                ", sendWelcomeMail=" + sendWelcomeMail +
                ", closeCampActivity=" + closeCampActivity +
                ", battleTimeoutToAI=" + battleTimeoutToAI +
                '}';
    }
}
